#include<bits/stdc++.h>
using namespace std;
const int N=300010;
int tot,first[N],nnext[N<<1],to[N<<1],dep[N];
void add(int x,int y){
	nnext[++tot]=first[x];
	first[x]=tot;
	to[tot]=y;
}
int vis[N];
void dfs(int u,int fa){
	for(int e=first[u];e;e=nnext[e]){
		if(to[e]!=fa){
			dep[to[e]]=dep[u]+1;
			//assert(!vis[dep[to[e]]]);
			vis[dep[to[e]]]=1;
			dfs(to[e],u);
		}
	}
}
int main(){
	freopen("nim.in","r",stdin);
	freopen("nim.out","w",stdout);
	int n,x,a,b,c,d;
	scanf("%d%d%d%d",&n,&x,&a,&b);
	if(a<=b){
		printf("1");
		return 0;
	}
	for(int i=1;i<=n-1;i++){
		scanf("%d%d",&c,&d);
		add(c,d);
		add(d,c);
	}
	dfs(x,0);
	for(int i=1;i<=n;i++){
		if((dep[i]>=n-a&&dep[i]%a<=b*(dep[i]/a+1))||(a*(dep[i]/a+1)<=n-1&&dep[i]%a+b>=a&&dep[i]%a)||(dep[i]/a-1)*b>=dep[i]%a+1){
			printf("%d",i);
			return 0;
		}
	}
}